package samples.chapter05;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/chapter05")
@RestController
public class Chapter05BookController {
     @Autowired
     Chapter05BookService bookService;

    @GetMapping("/bookOps")
    public void bookOps() {
        Chapter05Book book = new Chapter05Book();
        book.setName("西游记");
        book.setAuthor("王实甫");
        bookService.addBook(book);
        System.out.println("book:" + book);
    }
}
